<?php
if(!isset($year)) $year=0;
if(!isset($month)) $month=0;
if(!isset($day)) $day=0;
?>

<span><select id="<?php echo isset($yid) ? $yid : 'year';?>" name="<?php echo isset($yname) ? $yname : 'year';?>" class="year">
    <option <?php echo 0==$year ? 'selected="selected"':''; ?> value="0">请选择</option>
    <?php
    if(!isset($ystart)) $ystart=1980;
    for($i=date("Y");$i>=$ystart;$i--){
        echo  '<option '.($i==$year ? 'selected="selected"':'').' value="'.$i.'">'.$i.'</option>';
    }
    ?>
</select> </span>
<span>年</span>

<span><select id="<?php echo isset($mid) ? $mid : 'month';?>" name="<?php echo isset($mname) ? $mname : 'month';?>" class="month">
    <option <?php echo 0==$month ? 'selected="selected"':''; ?> value="0">请选择</option>
    <?php
    for($i=12;$i>=1;$i--){
        echo  '<option '.($i==$month ? 'selected="selected"':'').' value="'.$i.'">'.$i.'</option>';
    }
    ?>
</select></span>
<span>月</span>

<span><select id="<?php echo isset($did) ? $did : 'day';?>" name="<?php echo isset($dname) ? $dname : 'day';?>" class="day">
    <option <?php echo 0==$day ? 'selected="selected"':''; ?> value="0">请选择</option>
    <?php
    for($i=31;$i>=1;$i--){
        echo  '<option '.($i==$day ? 'selected="selected"':'').' value="'.$i.'">'.$i.'</option>';
    }
    ?>
</select></span>
<span>日</span>